package cn.distant.tank;

import java.awt.*;

/**
 * @author distantstar
 * @version 1.0
 * @date 2021
 * @description cn.distant.tank
 * @since JDK1.8
 */
public class Explode {
    private int x, y;
    static int width = ResourceMgr.explode[0].getWidth(), height = ResourceMgr.explode[0].getHeight();
    private boolean live = true;
    private TankFrame tf;
    private int step = 0;

    public Explode(int x, int y, TankFrame tf) {
        this.x = x;
        this.y = y;
        this.tf = tf;

        new Audio("audio/explode.wav");
    }

    public void paint(Graphics g) {
        g.drawImage(ResourceMgr.explode[step++], x, y, null);

        if (step > ResourceMgr.explode.length - 1) {
            tf.explodes.remove(this);
        }
    }
}
